package com.jqh.arouterdemo;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;

@Interceptor(priority = 1)
public class UseIInterceptor implements IInterceptor {
    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        String name = Thread.currentThread().getName();
        Log.d("Interceptor ", "UseIInterceptor process 拦截器开始 线程：" + name );
        if(postcard.getPath().equals(RoutePath.ACTIVITY_URL_HOME)) {
            // 处理当前拦截器
        }
        callback.onContinue(postcard);
    }

    @Override
    public void init(Context context) {
        Log.d("Interceptor", "UseIInterceptor Interceptor init");
    }
}
